Images taken by an image capture device, such as a scanner and a digital camera, contain noise, such as dark-current noise, thermal noise, and shot noise. This noise depends on the characteristics of the imaging elements and circuits. To form a high-quality image, a process is needed that reduces the noise. However, if the noise is reduced in a simple manner using a low-pass filter, elements such as edges that are important to making an image recognizable to a viewer of the image are lost and, eventually, the quality of the image is reduced. Therefore, a technology is required for noise reduction that is in accordance with the characteristics of different sections of the image.
One such noise reduction technology uses an ε filter (see Non-patent document 1: “ε-Separating Non-linear Digital Filter and Its Application,” The transactions A of the Institute of Electronics, Information and Communication Engineers, Vol. J65-A, No. 4, pp. 297-304, 1982 by Hiroshi Harashima, Kaoru Odajima, Yoshiaki Shishikui, and Hiroshi Miyagawa). The ε filter can replace the pixel value of a focus pixel with the average value of pixels that are selected from surrounding pixels in such a manner that the difference between the signal of the focus pixel and the signal of each selected pixel is less than or equal to a threshold, thereby reducing noise while maintaining components, such as edges, that have a large signal difference.
Moreover, with a technology using a bilateral filter (see Non-patent document 2: “Bilateral Filtering for Gray and Color Images,” Proc. Sixth Int'l Conf. Computer Vision, pp. 839-846, 1998 by C. Tomasi and R. Manduchi), a filter coefficient is calculated for each surrounding pixel using the signal difference and the spatial distance between the focus pixel and the surrounding pixel, and then the pixel value of the focus pixel is replaced with the sum of the filter-coefficient multiplied pixel value of all the surrounding pixels. As with the ε filter, this technology also achieves both noise reduction and edge maintenance.
Various advanced ε filter/bilateral filter technologies have been disclosed. In an image capture system, etc., disclosed in Japanese Patent Application Laid-open No. 2008-205737 (Patent document 1), the distances between RGB values of the focus pixel and RGB values of the surrounding pixels are reflected in the filter coefficient. This enables an effective reduction of noise in a color image. With the image processing apparatus, etc., disclosed in Japanese Patent Application Laid-open No. 2007-288439 (Patent document 2), the difference between the color tone of the focus pixel and the color tone of the surrounding pixel is detected and the color-tone difference is then reflected in the filter coefficient, which enables smoothing in order to prevent the formation of a moiré pattern.
However, in the inventions related to the image processing apparatuses, etc., disclosed in the above patent documents 1 and 2, because the distance between individual pixels is reflected in the filter coefficient, if a high level of noise is present, an incorrect value is calculated as the distance between the pixels and an appropriate filter coefficient cannot be calculated, which disadvantageously reduces the noise reduction effect.
The present invention has been made to solve the above problems with the conventional technology, and an object of the present invention is to provide an image processing apparatus, an image processing method, and a computer program for calculating an appropriate filter coefficient so as to reduce noise while maintaining elements, such as edges, that are important to making an image recognizable to a viewer of the image.